package com.zy.kotlinmvplib.api



import com.zy.kotlinbaselibrary.net.RetrofitConfig

/**
 * Created by zy on 2018/10/15.
 */

class NetWorks private constructor() {

    companion object {

        private var mNetWorks: NetWorks? = null
        private val baseUrl: String = "https://www.apiopen.top/"

        val instance: NetWorks
            get() {
                if (mNetWorks == null) {
                    mNetWorks = NetWorks()
                }
                return mNetWorks!!
            }

    }



    public val apiService: Api by lazy {
        myConfigRetrofit(Api::class.java)
    }

    private fun <T> myConfigRetrofit(service: Class<T>): T {
        return RetrofitConfig.getRetrofitConfigInstance(baseUrl).configRetrofit(service)
    }


}


